package io;

import java.io.File;

import javax.swing.filechooser.FileFilter;

class OpenFileFilter extends FileFilter{

	
	public boolean accept(File f) {
		if (f.isDirectory()) {
			return true;
		}

		String extension = FileExtensionUtils.getExtension(f);
		if (extension != null) {
			if (extension.equals(FileExtensionUtils.XML)){
				return true;
			} else {
				return false;
			}
		}

		return false;
	}


	@Override
	public String getDescription() {
		return "Prescription XML (*.xml)";
	}

}
